'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  router.get('/tmp', controller.home.tmp);
  router.get('/m', controller.home.mobile);
  // router.get('/file', controller.home.getfile);
  router.get('/api/getfile', controller.api.getFile);
  router.put('/api/putfile', controller.api.putFile);
  router.put('/api/tmpfile', controller.api.tmpFile);

  router.post('/api/login', controller.api.login);
  router.get('/api/profile', app.jwt, controller.api.profile);

  router.get('/api/listfile', app.jwt, controller.api.listFile);
  router.get('/api/filestatus', controller.api.getFileStatus);
  // admin
  router.get('/admin', controller.admin.index);
  router.post('/admin/upload', controller.admin.upload);
  router.get('/admin/css', controller.admin.css);
};
